/**
 * 
 */

package com.chengyu.eyc.config;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

import com.chengyu.eyc.interceptor.EycMybatisInterceptor;

import tk.mybatis.mapper.autoconfigure.ConfigurationCustomizer;

/**
 * @author kevin
 *
 */
 @Configuration
public class MybatisConfig {

    @Bean
    ConfigurationCustomizer mybatisConfigurationCustomizer() {
        return new ConfigurationCustomizer() {

            @Override
            public void customize(org.apache.ibatis.session.Configuration configuration) {
                configuration.addInterceptor(new EycMybatisInterceptor());
            }

        };
    }

}
